﻿{% extends "meetup_frame.html" %}
{% block title %}
用户资料
{% endblock %}

{% block content %}
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
	<div class="biaoti3">
		<div class="biaoti5">
			<h1>基本设置</h1>

			<div>
				<p><img src="{{user.profile.photo.url}}"/></p>
				<p>姓名：{{user.profile.name}}</p>
				<p>邮箱：{{user.email}}</p>
			</div>
			<div>性别：
				<label>
					<input type="radio" name="sex" value="男" />
				</label>
				男 
				<label>
					<input type="radio" name="sex" value="女" />
					女</label>
				<span class="error">{% if form.sex.errors%}&nbsp;*{{form.sex.errors.0}}{% endif %}	</span>
				<p>目前身份：
				<label>
					<input type="radio" name="profession" value="工作" />
				</label>
				已工作  
				<label>
					<input type="radio" name="profession" value="学生" />
				</label>
				学生 
				<label>
					<input type="radio" name="profession" value="其他" />
				</label>
				其他
				<span class="error">{% if form.profession.errors%}&nbsp;*{{form.profession.errors.0}}{% endif %}	</span>
				</p>

				<p>
				联系电话：<input type="text" name="phone" value="{{user.profile.phone}}"/>
				</p>
			</div>
		</div>
		{% if first %}
		<div class="biaoti5">
			<p>您为什么加入相聚网？</p>
			<p>
			<label>
				<textarea name="reason" cols="50" rows="5"></textarea>
			</label>
			</p>
		</div>
		{% endif %}
		<div class="biaoti5">
			<p>上传照片</p>
			<p>
			<label>
				<input type="file" name="photo" />
			</label>
			<label></label>
			</p>
		</div>
		<p><label>
			<input name="Submit" type="submit" class="button" value="提交" />
		</label></p>
	</div>
</form>

<script type="text/javascript">
	for (var i = 0; i < document.forms[0].sex.length; i++)
{
	if (document.forms[0].sex[i].value == "{{user.profile.sex}}")
	{
		document.forms[0].sex[i].checked = true;
	}
}
for (var i = 0; i < document.forms[0].profession.length; i++)
{
	if (document.forms[0].profession[i].value == "{{user.profile.profession}}")
	{
		document.forms[0].profession[i].checked = true;
	}
}
</script>

{% endblock %}
